package org.nerdpod.feed.server;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.nerdpod.feed.FeedHelper;
import org.nerdpod.feed.FusionTableHelper;
import org.nerdpod.feed.IncidentBean;

@SuppressWarnings("serial")
public class UpdateFeedServiceImpl extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
        resp.setContentType("text/html");
        resp.getWriter().println("Hello, world. <br/><br/>");
        resp.getWriter().println("<pre>");
        List<IncidentBean> incidents = FeedHelper.getIncidents();
//        resp.getWriter().println("Found " + incidents.size() + " incidents");
        resp.getWriter().println(FusionTableHelper.addIncidents(incidents));
        resp.getWriter().println("</pre>");

    }
}
